/*
 * Copyright (c) 2021-2022 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// NOLINTBEGIN(readability-identifier-naming)

% Builtins.spaces.each do |space|
namespace <%= space.name.snakecase  %> { // <%= space.name  %> NOLINT(modernize-concat-nested-namespaces)
%   space.properties.each do |property|
    <%= property.gen_propertydef %>
%   end
%   space.cpp_functions_decls.each do |cpp_decl|
    <%= cpp_decl %>
%   end
%   if space.prototype
    namespace proto {
%       space.prototype.properties.each do |property|
        <%= property.gen_propertydef %>
%       end
%       space.prototype.cpp_functions_decls.each do |cpp_decl|
        <%= cpp_decl %>
%       end
    }  // namespace proto
%   end
}  // namespace <%= space.name.snakecase %>

% end

% Builtins.internal_spaces.each do |ispace|
namespace <%= ispace.name.snakecase  %> { // <%= ispace.name  %>
%   ispace.cpp_functions_decls.each do |cpp_decl|
    <%= cpp_decl %>
%   end
%   if ispace.prototype
    namespace proto {
%       ispace.prototype.cpp_functions_decls.each do |cpp_decl|
        <%= cpp_decl %>
%       end
    }  // namespace proto
%   end
}  // namespace <%= ispace.name.snakecase %>

% end

// NOLINTEND(readability-identifier-naming)
